package weekMatch.two_106;

import javafx.scene.effect.SepiaTone;

import java.util.HashSet;
import java.util.Set;

public class LeeCode_01 {
    public static void main(String[] args) {
        System.out.println(isFascinating(384));
    }
    private static boolean isFascinating(int n) {
        long num = (long) (n * Math.pow(10, Integer.toString(n * 2).length()) + n * 2L);
        num *= Math.pow(10, Integer.toString(n * 3).length());
        num += n * 3L;
        Set<Integer> set = new HashSet<>();
        while (num != 0){
            int t = (int) (num % 10);
            if (set.contains(t))
                return false;
            set.add(t);
            num /= 10;
        }
        return !set.contains(0) && set.size() == 9;
    }
}